#include "../include/http_server.h"
#include "../include/index_factory.h"
#include "../include/logger.h"

int main() {
    init_global_logger();
    set_log_level(spdlog::level::debug);

    GlobalLogger->info("Global logger initialized");

    int dim = 1;
    int num_data = 1000;
    IndexFactory* globalIndexFactory = getGlobalIndexFactory();
    globalIndexFactory->init(IndexFactory::IndexType::FLAT, dim);
    globalIndexFactory->init(IndexFactory::IndexType::FLAT, dim, num_data);
    GlobalLogger->info("Global IndexFactory initialized");

    HttpServer server("localhost", 8080);
    GlobalLogger->info("HttpServer created");
    server.start();

    return 0;
}
